<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusWorkflowNodeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_workflow_node', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('node_name')->nullable()->comment('节点名称');
            $table->string('node_key')->nullable()->unique()->comment('节点标记');
            $table->integer('role_id')->nullable()->comment('角色ID');
            $table->tinyInteger('type')->nullable()->comment('节点类型');
            $table->unsignedBigInteger('workflow_id')->comment('人员ID');
            $table->foreign('workflow_id')->references('id')->on('akbus_workflow')->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_workflow_node');
    }
}
